import { Router } from "vue-router";

export default function createTransitionHook(router: Router) {
  router.afterEach((to, from) => {
    const toDepth = to.path.split("/").length;
    const fromDepth = from.path.split("/").length;
    to.meta.transitionName = toDepth < fromDepth ? "slide-right" : "slide-left";
  });
}
